<style>
    .layui-form-switch {
        position: relative;
        height: 22px;
        line-height: 22px;
        min-width: 35px;
        padding: 0 5px;
        margin-top: 8px;
        border: 1px solid #d2d2d2;
        border-radius: 20px;
        cursor: pointer;
        background-color: #fff;
        -webkit-transition: .1s linear;
        transition: .1s linear;
        width: 50px;

    }
    .layui-form-onswitch {
        border-color: #5FB878;
        background-color: #5FB878;
        width: 50px;
    }
    .layui-form-onswitch i {
        left: 100%;
        margin-left: -21px;
        background-color: #fff;
    }
</style>
<form action="{:url()}" method="post" class="form_single layui-form">
    <div class="box">
        <div class="layui-form-item" >
            <label class="layui-form-label">支付方式</label>
            <div class="layui-input-block">
                <input type="radio" lay-filter="test" name="type_text" value="支付宝" title="支付宝"    checked >
                <input type="radio" lay-filter="test" name="type_text" value="微信" title="微信"    >
                <input type="radio" lay-filter="test" name="type_text" value="银行卡" title="银行卡"    >
            </div>
        </div>


        <div class="box-body alipay" >
            <h1>支付宝</h1>
            <div class="row">
                <div class="layui-form-item">
                    <label  class="layui-form-label">
                        支付宝真实姓名
                    </label>
                    <div class="layui-input-block">
                        <input type="text" onchange="this.value=this.value.substring(0, 30)" onkeydown="this.value=this.value.substring(0, 30)" onkeyup="this.value=this.value.substring(0, 30)"  name="alipay[true_name]" value="{$list['alipay']['true_name']|default=''}"
                               autocomplete="off" class="layui-input" />
                    </div>
                    <div  class="layui-form-mid layui-word-aux">
                        （支付宝真实姓名）
                    </div>

                </div>
                <div class="layui-form-item">
                    <label  class="layui-form-label">
                        支付宝账号
                    </label>
                    <div class="layui-input-block">
                        <input type="text" onchange="this.value=this.value.substring(0, 30)" onkeydown="this.value=this.value.substring(0, 30)" onkeyup="this.value=this.value.substring(0, 30)"  name="alipay[bank_card]" value="{$list['alipay']['bank_card']|default=''}"
                               autocomplete="off" class="layui-input" />
                    </div>
                    <div  class="layui-form-mid layui-word-aux">
                        （支付宝账号）
                    </div>

                </div>

                <input name="alipay[id]"  value="{$list['alipay']['id']|default=''}" type="hidden">

                <div class="layui-form-item">
                    <label for="logo" class="layui-form-label">
                        <span class="x-red">*</span>收款二维码
                    </label>
                    <div id="logo1" class="layui-input-block">
                        {assign name="cover_id" value="$list['alipay']['cover_id']|default='0'" /}
                        {:widget('file/index', ['name' => 'alipay_cover_id', 'value' => $cover_id, 'type' => 'img'])}
                    </div>
                    <!--<div class="layui-form-mid layui-word-aux">-->
                    <!--(请上传单张封面图片)-->
                    <!--</div>-->
                </div>


            </div>



        </div>
        <div class="box-body bank" style="display: none">
            <h1>银行卡</h1>
            <div class="row">
                <div class="layui-form-item">
                    <label  class="layui-form-label">
                        银行卡真实姓名
                    </label>
                    <div class="layui-input-block">
                        <input type="text" onchange="this.value=this.value.substring(0, 30)" onkeydown="this.value=this.value.substring(0, 30)" onkeyup="this.value=this.value.substring(0, 30)"  name="bank[true_name]" value="{$list['bank']['true_name']|default=''}"
                               autocomplete="off" class="layui-input" />
                    </div>
                    <div  class="layui-form-mid layui-word-aux">
                        （ 银行卡真实姓名）
                    </div>

                </div>
                <div class="layui-form-item">
                    <label  class="layui-form-label">
                        银行卡号
                    </label>
                    <div class="layui-input-block">
                        <input type="text" onchange="this.value=this.value.substring(0, 30)" onkeydown="this.value=this.value.substring(0, 30)" onkeyup="this.value=this.value.substring(0, 30)"  name="bank[bank_card]" value="{$list['bank']['bank_card']|default=''}"
                               autocomplete="off" class="layui-input" />
                    </div>
                    <div  class="layui-form-mid layui-word-aux">
                        （银行卡号）
                    </div>

                </div>
                <div class="layui-form-item">
                    <label  class="layui-form-label">
                        银行地址
                    </label>
                    <div class="layui-input-block">
                        <input type="text" onchange="this.value=this.value.substring(0, 30)" onkeydown="this.value=this.value.substring(0, 30)" onkeyup="this.value=this.value.substring(0, 30)"  name="bank[bank_address]" value="{$list['bank']['bank_address']|default=''}"
                               autocomplete="off" class="layui-input" />
                    </div>
                    <div  class="layui-form-mid layui-word-aux">
                        （银行地址）
                    </div>

                </div>
                <div class="layui-form-item">
                    <label  class="layui-form-label">
                        开户银行
                    </label>
                    <div class="layui-input-block">
                        <input type="text" onchange="this.value=this.value.substring(0, 30)" onkeydown="this.value=this.value.substring(0, 30)" onkeyup="this.value=this.value.substring(0, 30)"  name="bank[opening_bank]" value="{$list['bank']['opening_bank']|default=''}"
                               autocomplete="off" class="layui-input" />
                    </div>
                    <div  class="layui-form-mid layui-word-aux">
                        （开户银行）
                    </div>

                </div>

                <input class="form-control" name="bank[id]"  value="{$list['bank']['id']|default=''}" type="hidden">

            </div>

            <input name="user_id"  value="{$uid}" type="hidden">

        </div>
        <!--<div class="box-body">-->
            <!--<h1>数字货币</h1>-->
            <!--<div class="row">-->
                <!--<div class="col-md-6">-->
                    <!--<div class="form-group">-->
                        <!--<label>数字货币种类</label>-->
                        <!--<span class="">（数字货币种类）</span>-->
                        <!--<select name="eth[currency_id]">-->
                        <!--{volist name='wallet' id='vo'}-->
                        <!--<option value="{$vo['id']}" {notempty name="$list['eth']"}{if condition="$list['eth']['currency_id'] eq $vo['id']"} selected="selected" {/if}{/notempty} >{$vo['name']}</option>-->
                        <!--{/volist}-->
                        <!--</select>-->
                    <!--</div>-->
                <!--</div>-->
                <!--<div class="col-md-6">-->
                    <!--<div class="form-group">-->
                        <!--<label>数字货币地址</label>-->
                        <!--<span class="">（数字货币地址）</span>-->
                        <!--<input class="form-control" name="eth[currency_address]" placeholder="请输入数字货币地址" value="{$list['eth']['currency_address']|default=''}" type="text">-->
                    <!--</div>-->
                <!--</div>-->
                <!--<input name="eth[id]"  value="{$list['eth']['id']|default=''}" type="hidden">-->
                <!---->


            <!--</div>-->



        <!--</div>-->
        <div class="box-body weixin" style="display: none">
            <h1>微信</h1>
            <div class="row">
                <div class="layui-form-item">
                    <label  class="layui-form-label">
                        微信真实姓名
                    </label>
                    <div class="layui-input-block">
                        <input type="text" onchange="this.value=this.value.substring(0, 30)" onkeydown="this.value=this.value.substring(0, 30)" onkeyup="this.value=this.value.substring(0, 30)"  name="wechat[true_name]" value="{$list['wechat']['true_name']|default=''}"
                               autocomplete="off" class="layui-input" />
                    </div>
                    <div  class="layui-form-mid layui-word-aux">
                        （微信真实姓名）
                    </div>

                </div>
                <div class="layui-form-item">
                    <label  class="layui-form-label">
                        微信账号
                    </label>
                    <div class="layui-input-block">
                        <input type="text" onchange="this.value=this.value.substring(0, 30)" onkeydown="this.value=this.value.substring(0, 30)" onkeyup="this.value=this.value.substring(0, 30)"  name="wechat[bank_card]" value="{$list['wechat']['bank_card']|default=''}"
                               autocomplete="off" class="layui-input" />
                    </div>
                    <div  class="layui-form-mid layui-word-aux">
                        （微信账号）
                    </div>

                </div>

                <input name="wechat[id]"  value="{$list['wechat']['id']|default=''}" type="hidden">


                <div class="layui-form-item">
                    <label for="logo" class="layui-form-label">
                        <span class="x-red">*</span>收款二维码
                    </label>
                    <div id="logo" class="layui-input-block">
                        {assign name="cover_id" value="$list['wechat']['cover_id']|default='0'" /}
                        {:widget('file/index', ['name' => 'wechat_cover_id', 'value' => $cover_id, 'type' => 'img'])}
                    </div>
                    <!--<div class="layui-form-mid layui-word-aux">-->
                    <!--(请上传单张封面图片)-->
                    <!--</div>-->
                </div>


            </div>



        </div>


        <div class="box-footer">


            {include file="layout/edit_btn_group"/}

        </div>

    </div>
    </div>
</form>

<script>
    layui.use('form', function(){
        var form = layui.form;

        //各种基于事件的操作，下面会有进一步介绍
        form.on('radio(test)', function(data){
            if(data.value=='支付宝'){
                $('.weixin').hide();
                $('.bank').hide();
                $('.alipay').show();
                form.render();
                console.log(data.value); //
                return;
            }
            if(data.value=='微信'){
                $('.weixin').show();
                $('.bank').hide();
                $('.alipay').hide();
                form.render();
                console.log(data.value);
                return;
            }
            if(data.value=='银行卡'){
                $('.weixin').hide();
                $('.bank').show();
                $('.alipay').hide();
                form.render();
                console.log(data.value); //
                return;
            }
         被点击的radio的value值
        });
    });

</script>



